package InheritanceAndPolymorphism.demo05;

public class Test {
    public static void main(String[] args) {
        Account account = new Account(1122, 20000, 4.5);
        account.withdraw(30000);
        System.out.println("余额: " + account.getBalance());
        account.withdraw(2500);
        account.deposit(3000);
        System.out.println("余额: " + account.getBalance());
        System.out.println("月利率: " + account.getMonthlyInterest());

        CheckAccount checkAccount = new CheckAccount(1122, 20000, 4.5, 5000);
        checkAccount.withdraw(5000);
        System.out.println("账户余额: " + checkAccount.getBalance() + ", 可透支额: " + checkAccount.getOverdraft());
        checkAccount.withdraw(18000);
        System.out.println("账户余额: " + checkAccount.getBalance() + ", 可透支额: " + checkAccount.getOverdraft());
        checkAccount.withdraw(3000);
        System.out.println("账户余额: " + checkAccount.getBalance() + ", 可透支额: " + checkAccount.getOverdraft());
    }
}
